package com.ljb.smartinspector;

import android.app.Application;
import android.util.Log;

import com.sensoro.cloud.SensoroManager;

/**
 * Created by lijianbin on 2017/3/24.
 */

public class App extends Application {
    private static final String TAG = "App";
    SensoroManager sensoroManager;

    @Override
    public void onCreate() {
        super.onCreate();
        initSensoro();
    }

    private void initSensoro() {
        sensoroManager = SensoroManager.getInstance(getApplicationContext());
        sensoroManager.setCloudServiceEnable(false);
    }

    @Override
    public void onTerminate() {
        if (sensoroManager != null) {
            sensoroManager.stopService();
            sensoroManager = null;
            Log.e(TAG, "onTerminate: 云子服务已停止");
        }
        super.onTerminate();
    }
}
